Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(LT-5508): orders and positions are fixed during state validation #526

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

gponomarev-lykke
Copy link

  • orders and positions are fixed during state validation
  • the fixed values are then used to create a draft snapshot
  • a retry policy added so the "trading data snapshot might be corrupted" fatal errors should be less frequent

- orders and positions are fixed during state validation
- the fixed values are then used to create a draft snapshot
- a retry policy added so the "trading data snapshot might be corrupted" fatal errors should be less frequent

namespace MarginTrading.Backend.Core.Orders
{
public interface IOrderReader

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should have a dedicated interface for InMemorySnapshot?
Something like IOrderReader: IOrderReaderBase, where IOrderReaderBase has only 2 required methods?

{
var ex = new InvalidOperationException(
$"The trading data snapshot might be corrupted. The current state of orders and positions is incorrect. Check the dbo.BlobData table for more info: container {LykkeConstants.MtCoreSnapshotBlobContainer}, correlationId {correlationId}");
await _log.WriteFatalErrorAsync(nameof(SnapshotService),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case of not valid result we still will have a fatal error I think. Ant this will happen on every retry. Is that expected? And if yes, why?

"The current state of orders and positions is correct.");
}

return validationResult;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also SnapshotStateValidationPolicy will retry on exceprion, but this method will not throw an exception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants